package com.qf.controller;

import com.qf.util.Message;
import com.weather.cn.com.webxml.MobileCodeWS;
import com.weather.cn.com.webxml.MobileCodeWSSoap;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 2019/9/26
 * Administrator
 * ssm0923
 * 面向对象面向君  不负代码不负卿
 */
@Controller
public class PhoneController {

    @Resource
    private  MobileCodeWSSoap wsSoap;
    @RequestMapping("/getphonecity")
    @ResponseBody
    public Message getcity(String phone){
     /*   //1.创建服务对象
        MobileCodeWSSoap port = ws.getPort(MobileCodeWSSoap.class);
        String codeInfo = port.getMobileCodeInfo(phone, "");
        System.out.println(codeInfo);
        String[] split = codeInfo.split("：");
        Message message=new Message();
        message.setStr(split[1]);*/
     //cxf
        String codeInfo = wsSoap.getMobileCodeInfo(phone, "");
        String[] split = codeInfo.split("：");
        Message message=new Message();
        message.setStr(split[1]);
        return message;
    }
}
